package com.zxmclasslibrarie.view.wtflist;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.zxmclasslibrarie.view.activity.application.R;
import com.zxmclasslibrarie.view.wtflist.WeiboListWidget.OnWeiboListOnClickListenner;

public class WeiboListIView implements OnClickListener {

	private OnWeiboListOnClickListenner listenner = null;

	public View view = null;
	public TextView mtTextView = null;
	public android.widget.ImageView mImageView = null;
	public Context mContext = null;

	public int height = 0;
	public int posation = 0;

	public WeiboListIView(Context mContext, int posation) {
		this.mContext = mContext;
		this.posation = posation;
		setView(mContext);
		setClick();
	}

	private void setView(Context mContext) {
		LayoutInflater mInflater = (LayoutInflater) mContext
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		view = mInflater.inflate(R.layout.listtiem, null);
		mtTextView = (TextView) view.findViewById(R.id.list_text_date);
		mImageView = (ImageView) view.findViewById(R.id.list_image);
	}

	private void setClick() {
		view.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		listenner.weiboListOnClickListenner(posation);
	}

	public void setItemListenner(OnWeiboListOnClickListenner listenner) {
		if (null != listenner) {
			this.listenner = listenner;
		}
	}

	public TextView getMtTextView() {
		return mtTextView;
	}

	public android.widget.ImageView getmImageView() {
		return mImageView;
	}

	public View getView() {
		return view;
	}
}
